//
//  HMWelcomeView.swift
//  Weibo-walker
//
//  Created by 郭彬 on 16/3/6.
//  Copyright © 2016年 guobin. All rights reserved.
//

import UIKit
import SnapKit
class HMWelcomeView: UIView {

 
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.setupUI()
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //MARK: - setupUI
    
    func setupUI() {
        
        backgroundColor = UIColor.redColor()
        //添加控件
        addSubview(iconImage)
        addSubview(label)
        
        //添加约束
        
//        headImage.snp_makeConstraints { (make) -> Void in
//            make.centerX.equalTo(self.view)
//            make.top.equalTo(200)
//            make.size.equalTo(CGSizeMake(90, 90))
//        }

        iconImage.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(self)
            make.top.equalTo(200)
            make.size.equalTo(CGSizeMake(90, 90))
        }
        label.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(self).offset(8)
            make.top.equalTo(iconImage.snp_bottom).offset(10)
            make.width.equalTo(iconImage)
            make.height.equalTo(20)
        }
    }
    
    
    
    lazy var iconImage:UIImageView = {
        
        let iconImage = UIImageView(image: UIImage(named: "avatar_default"))
        
        return iconImage
    }()
    
    lazy var label:UILabel = {
        
        let label = UILabel()
        label.tintColor = UIColor.grayColor()
        
        label.text = "欢迎回来"
        
        return label
        
    }()


}
